import { Dept } from '../../api/Dept';
import { Room } from '../../api/Room';
import { Card } from '../base/Card';

export class BeaconAlarm extends Card {
	title(room: Room, user: string): string {
		return '烽燧预警';
	}

	stength(dept: Dept) {
		return Math.floor(dept.getDeptDataValue('military') / 5);
	}

	desc(room: Room, user: string): string {
		const dept = room.getDept('bing');
		if (!dept) return '';
		return `+${this.stength(dept)}国力`;
	}

	use(room: Room, user: string, target: string): void {
		const dept = room.getDept('bing');
		if (!dept) return;
		dept.addDeptDataValue('stength', this.stength(dept));
	}
}
